package com.lmabbe.tenant.objects.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsNativeDefValue;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.annotation.Unique;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.lmabbe.common.global.constant.GlobalConstant;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 租户信息表
 *
 * @author lmabbe
 * @TableName tenant_info
 */
@Data
@Table(isSimple = true, excludeFields = "serialVersionUID", comment = "租户信息表")
public class TenantInfo implements Serializable {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table tenant_info
     *
     * @mbg.generated 2021-03-13 16:06:09
     */
    private static final long serialVersionUID = 1L;
    /**
     * ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "ID")
    @Column(isKey = true, isNull = false, length = 32, comment = "租户ID")
    private Long tenantId;
    /**
     * 租户编码
     *
     * @mbg.generated 2021-03-13 16:06:09
     */
    @Unique
    @Column(length = 32, isNull = false, comment = "租户编码")
    private String tenantCode;
    /**
     * 公司名称
     *
     * @mbg.generated 2021-03-13 16:06:09
     */
    @Column(comment = "公司名称")
    private String companyName;
    /**
     * 公司logo
     *
     * @mbg.generated 2021-03-13 16:06:09
     */
    @Column(comment = "公司logo")
    private String companyLogo;
    /**
     * 过期时间
     */
    @Column(comment = "过期时间")
    private Date overdueTime;

    /**
     * 是否有效(1.有效 0.无效 -1.软删除)
     */
    @TableField()
    @ApiModelProperty(value = "是否有效(1.有效 0.无效 -1.软删除)")
    @Column(comment = "是否有效(1.有效 0.无效 -1.软删除)", defaultValue = "1")
    @TableLogic(value = GlobalConstant.IS_VALID.YES_STR, delval = GlobalConstant.IS_VALID.DELETE_STR)
    private Integer valid;

    /**
     * 创建人
     *
     * @mbg.generated 2021-03-13 16:06:09
     */
    @TableField(fill = FieldFill.INSERT)
    @Column(isNull = false, comment = "创建人", defaultValue = "system")
    private String createBy;
    /**
     * 创建时间
     *
     * @mbg.generated 2021-03-13 16:06:09
     */
    @IsNativeDefValue
    @TableField(fill = FieldFill.INSERT)
    @Column(isNull = false, comment = "创建时间", type = MySqlTypeConstant.TIMESTAMP, defaultValue = "CURRENT_TIMESTAMP")
    private Date createTime;
    /**
     * 修改人
     *
     * @mbg.generated 2021-03-13 16:06:09
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Column(isNull = false, comment = "修改人", defaultValue = "system")
    private String modifyBy;
    /**
     * 修改时间
     *
     * @mbg.generated 2021-03-13 16:06:09
     */
    @IsNativeDefValue
    @Column(isNull = false, comment = "修改时间", type = MySqlTypeConstant.TIMESTAMP, defaultValue = "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date modifyTime;
}